package com.qingcloud.adminbackend.entity.message;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 事件类型配置表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_message_type_config")
public class SysMessageTypeConfig extends Model {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "类型名称")
    @NotNull(message = "类型不能为空！")
    private String typeName;


    @ApiModelProperty(value = "标题")
    @NotNull(message = "事件标题不能为空！")
    private String title;

    /**例如：
     * {
     *
     *     "equipmentId": "77770001",
     *
     *     "TYPE": 0X01
     *
     *     "warningContent": 1
     *
     *     "warningText": 1,
     *
     *     "warningType": 12
     *
     * }
     */
    @ApiModelProperty(value = "事件属性")
    private String eventProperties;

    /**例如
     * 设备${equipmentId}${warningType}${warningText}。故障时间：${eventTime}
     */
    @ApiModelProperty(value = "事件模板")
    @NotNull(message = "事件模板不能为空！")
    private String eventTemplate;

    @ApiModelProperty(value = "是否删除0：否；1是")
    private Integer deleteFlag;

    @ApiModelProperty(value = "事件类型属性字段")
    @TableField(exist = false)
    private List<SysMessageTypeField> fieldList;
}
